package com.camera.road.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class HomeView extends Composite {

	private static HomeViewUiBinder uiBinder = GWT
			.create(HomeViewUiBinder.class);

	interface HomeViewUiBinder extends UiBinder<Widget, HomeView> {
	}

	@UiField
	Button button;

	public HomeView() {
		initWidget(uiBinder.createAndBindUi(this));
		button.setText("firstName");
	}

	@UiHandler("button")
	void onClick(ClickEvent e) {
		Window.alert("Hello!");
	}
	
	public void show(){
//		MessageConsole.setText("开始获取图片");
//		PhotoTimer = new Timer() {
//			public void run() {
//				String tmp = "0";
//				if(mphoto.getId().length()>0){
//					tmp = mphoto.getId();
//					MessageConsole.setText("提取图片 " + tmp);
//				} else {
//					tmp = "0";
//				}
//				
//				GWT.log("提取图片 " + mphoto.getId() == null ? "":mphoto.getId(), null);
//				long id = 0;
//				try {
//					if(tmp.length()<1){
//						return;
//					}
//					id = Long.parseLong(tmp);
//				} catch (NumberFormatException e) {
//					e.printStackTrace();
//				}
//				photoService.getPhoto(cIdent, id, callback);
//			}
//		};
//		PhotoTimer.run();
	}

	public void hide(){
//		if( PhotoTimer != null )
//		{
//			PhotoTimer.cancel();
//			PhotoTimer = null;
//			MessageConsole.setText("终止图片获取");
//		}
	}

}
